<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script>
  let eg = {name:'test'};
  let parent = {
    name:'parent',
    show(){
      // 注意此处this的指向问题，始终指向的是调用方法的对象
      console.log("parent: show() ....name = "+this.name)
    }
  }
  // 设置原型属性
  Object.setPrototypeOf(eg,parent)
  console.log(eg)

  eg.show();

  //  获取原型属性
  console.log(Object.getPrototypeOf(eg))
</script>
</html>